package top.hzy520;

import com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.web.HttpMessageConverters;
import org.springframework.context.annotation.Bean;
import org.springframework.http.converter.HttpMessageConverter;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;


@SpringBootApplication
public class YuyuBuyServiceAdmin1Application {

    private final static Logger logger = LoggerFactory.getLogger(YuyuBuyServiceAdmin1Application.class);
    public static void main(String[] args) {
        SpringApplication.run(YuyuBuyServiceAdmin1Application.class, args);
        logger.info("YuyuBuyServiceAdmin1Application is success!");
    }

    @Bean
    public HttpMessageConverters fastJsonHttpMessageConverters(){
        FastJsonHttpMessageConverter fastconverter=new FastJsonHttpMessageConverter();
        HttpMessageConverter<?> converter=fastconverter;
        return new  HttpMessageConverters(converter);
    }
    @Bean
    public BCryptPasswordEncoder passwordEncoder(){return new BCryptPasswordEncoder();}
}
